import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import {getCategorAPI} from '@/api/catorgre/index.js'
 const useCategoryStore = defineStore('category',()=>{
    const list = ref([])
    const getCategory = async () => {
        if(list.length>1) return true;
        const response = await getCategorAPI()
        list.value = response.result;
        console.log(list.value)
        return list
    }
    return {
        list,
        getCategory
    }
})
export default useCategoryStore